//
//  UIImage+Extensions.m
//  NewWeiBo_OC
//
//  Created by 陈竹 on 16/2/22.
//  Copyright © 2016年 陈竹. All rights reserved.
//

#import "UIImage+Extensions.h"

@implementation UIImage (Extensions)

+(UIImage *)cz_singleDotImage:(UIColor*)color{
    
    //开启图形上下文
    UIGraphicsBeginImageContextWithOptions(CGSizeMake(1, 1), NO, [UIScreen mainScreen].scale);
    
    //填充颜色，画图形
    [color setFill];
    UIRectFill(CGRectMake(0, 0, 1, 1));
    
    
    //获取图形上下文中的image
    UIImage *image=UIGraphicsGetImageFromCurrentImageContext();
    
    //关闭图形上下文
    UIGraphicsEndImageContext();
    return image;

}
@end
